package gorm

import (
	"go-main/library/net/netutil/breaker"
	xtime "go-main/library/time"
	"gorm.io/gorm"
)

type Config struct {
	DSN          string          // dsn
	Active       int             // pool
	Idle         int             // pool
	IdleTimeout  xtime.Duration  // connect max life time.
	QueryTimeout xtime.Duration  // query sql timeout
	ExecTimeout  xtime.Duration  // execute sql timeout
	TranTimeout  xtime.Duration  // transaction sql timeout
	Breaker      *breaker.Config // breaker
	SlowLog      xtime.Duration
	Backward     bool // gorm v1 compatibility: library/database/orm
}

type DB struct {
	conf *Config
	//dis   naming.Resolver
	appid string
	Db    *gorm.DB
}
